package com.mall.shopping.dto;

import com.mall.commons.result.AbstractRequest;
import com.mall.commons.tool.exception.ValidateException;
import com.mall.shopping.constants.ShoppingRetCode;
import lombok.Data;

/**
 * @User: Yr
 * @Date: 2021/12/13
 * @Description:
 */

@Data
public class ProductDetailReq extends AbstractRequest {

    Long id;

    @Override
    public void requestCheck() {
        //参数非法则抛出异常
        if (id == null || id <= 0){
            throw new ValidateException(ShoppingRetCode.REQUEST_CHECK_FAILURE.getCode(),
                    ShoppingRetCode.REQUEST_CHECK_FAILURE.getMessage());
        }
    }
}
